from django.urls import path
from . import views

app_name = 'codes'

urlpatterns = [
    path('', views.code_list, name='code_list'),
    path('create/', views.code_create, name='code_create'),
    path('<int:code_id>/', views.code_detail, name='code_detail'),
    path('<int:code_id>/update/', views.code_update, name='code_update'),
    path('<int:code_id>/delete/', views.code_delete, name='code_delete'),
    path('<int:code_id>/toggle-public/', views.toggle_public, name='toggle_public'),
    path('<int:code_id>/toggle-starred/', views.toggle_starred, name='toggle_starred'),
    path('<int:code_id>/update-project-info/', views.update_project_info, name='update_project_info'),
    

    
    # 多文件管理
    path('<int:code_id>/files/', views.code_files_view, name='code_files'),
    path('<int:code_id>/upload/', views.upload_files, name='upload_files'),
    path('<int:code_id>/file/create/', views.edit_file, name='create_file'),
    path('<int:code_id>/file/<int:file_id>/edit/', views.edit_file, name='edit_file'),
    path('<int:code_id>/file/<int:file_id>/delete/', views.delete_file, name='delete_file'),
    path('<int:code_id>/download/', views.download_project, name='download_project'),
    path('<int:code_id>/api/file/<int:file_id>/', views.api_file_content, name='api_file_content'),
]